gdk: Redo GL drawing
authorBenjamin Otte <otte@redhat.com>
Wed, 23 Nov 2016 04:54:50 +0000 (05:54 +0100)
committerBenjamin Otte <otte@redhat.com>
Mon, 5 Dec 2016 14:02:47 +0000 (15:02 +0100)
commite38bd27d583c81d2052d23a7722e3e3482c3cf4d
treefa59bca6b9f1d898d9e942f526bcb8dae3e08c8b
parente87b472143a1116a571f0b49c07afbbc33a88a84
gdk: Redo GL drawing

Reenable GL drawing, but do it without Cairo.

Now, the context passed to gdk_window_begin_draw_frame() decides how
drawing is going to happen. If it is NULL, Cairo is used like before.

If a context is passed, Cairo may not be used for drawing and
gdk_drawing_context_get_cairo_context() is going to return NULL.
Instead, the GL renderer must draw to the GL backbuffer and
end_draw_frame() is then swapping that to the front.

The GskGLRenderer has lost the texture it used to render to and adapted
to render directly to the backbuffer instead.

The only thing missing is for GtkGLArea to gain back a performant way to
render. But it didn't have one since the introduction of GSK, this
patchset doesn't change anything about it.

The new rendering avoids two indirections (the GSK renderer's texture
and the GDK double buffering surface).
It improves icon count in the fishbowl demo by 30%.
gdk/gdkdrawingcontext.c
gdk/gdkwindow.c
gsk/gskglrenderer.c